package com.genexususa.eo.bing.test.set;

import com.genexususa.eo.bing.connection.CampaignManager;
import com.genexususa.eo.bing.test.TestUtil;

public class ConsumeSetNegativeKeywordsToCampaigns {
    public static void main(String[] args) {
        TestUtil testUtil = new TestUtil();
        String campaignNegativeKeywordsCollectionXML =  "<Bing_CampaignNegativeKeywordsCollection xmlns=\"https://adcenter.microsoft.com/v8\">\n" +
                                                            "\t<CampaignNegativeKeywords xmlns=\"https://adcenter.microsoft.com/v8\">\n" +
                                                                "\t\t<GxCampaignId>984948891</GxCampaignId>\n" +
                                                                "\t\t<BingCampaignId>" + testUtil.campaignId1 + "</BingCampaignId>\n" +
                                                                "\t\t<NegativeKeywordCollection>\n" +
                                                                    "\t\t\t<NegativeKeyword>Word1</NegativeKeyword>\n" +
                                                                    /*"\t\t\t<NegativeKeyword>Word2</NegativeKeyword>\n" +
                                                                    "\t\t\t<NegativeKeyword>Word2</NegativeKeyword>\n" +
                                                                    "\t\t\t<NegativeKeyword>Word3</NegativeKeyword>\n" +*/
                                                                "\t\t</NegativeKeywordCollection>\n" +
                                                            "\t</CampaignNegativeKeywords>\n" +
                "\t<CampaignNegativeKeywords xmlns=\"https://adcenter.microsoft.com/v8\">\n" +
                "\t\t<GxCampaignId>984948891</GxCampaignId>\n" +
                "\t\t<BingCampaignId>" + testUtil.campaignId1 + "</BingCampaignId>\n" +
                "\t\t<NegativeKeywordCollection>\n" +
                "\t\t\t<NegativeKeyword>Word5</NegativeKeyword>\n" +
                                                                    /*"\t\t\t<NegativeKeyword>Word2</NegativeKeyword>\n" +
                                                                    "\t\t\t<NegativeKeyword>Word2</NegativeKeyword>\n" +
                                                                    "\t\t\t<NegativeKeyword>Word3</NegativeKeyword>\n" +*/
                "\t\t</NegativeKeywordCollection>\n" +
                "\t</CampaignNegativeKeywords>\n" +
                                                            /*"\t<CampaignNegativeKeywords xmlns=\"https://adcenter.microsoft.com/v8\">\n" +
                                                                "\t\t<GxCampaignId>984948892</GxCampaignId>\n" +
                                                                "\t\t<BingCampaignId>" + testUtil.campaignId2 + "</BingCampaignId>\n" +
                                                                "\t\t<NegativeKeywordCollection>\n" +
                                                                    "\t\t\t<NegativeKeyword>Word3</NegativeKeyword>\n" +
                                                                "\t\t</NegativeKeywordCollection>\n" +
                                                            "\t</CampaignNegativeKeywords>\n" +*/
                                                        "</Bing_CampaignNegativeKeywordsCollection>";
        campaignNegativeKeywordsCollectionXML = "<Bing_AdGroupNegativeKeywordsRequestCollection xmlns=\"L2TMediaDev_L2T1.51\">\n" +
                "\t<Bing_AdGroupNegativeKeywordsRequest xmlns=\"L2TMediaDev_L2T1.51\">\n" +
                "\t\t<GxCampaignId>699</GxCampaignId>\n" +
                "\t\t<BingCampaignId>1951343212</BingCampaignId>\n" +
                "\t\t<AdGroupNegativeKeywordsCollection>\n" +
                "\t\t\t<AdGroupNegativeKeywords>\n" +
                "\t\t\t\t<GxAdGroupId xmlns=\"https://adcenter.microsoft.com/v8\">2262</GxAdGroupId>\n" +
                "\t\t\t\t<BingAdGroupId xmlns=\"https://adcenter.microsoft.com/v8\">1981353650</BingAdGroupId>\n" +
                "\t\t\t\t<NegativeKeywordCollection xmlns=\"https://adcenter.microsoft.com/v8\">\n" +
                "\t\t\t\t\t<NegativeKeyword>BMW</NegativeKeyword>\n" +
                "\t\t\t\t\t<NegativeKeyword>Ford</NegativeKeyword>\n" +
                "\t\t\t\t\t<NegativeKeyword>Bentley</NegativeKeyword>\n" +
                "\t\t\t\t</NegativeKeywordCollection>\n" +
                "\t\t\t</AdGroupNegativeKeywords>\n" +
                "\t\t</AdGroupNegativeKeywordsCollection>\n" +
                "\t</Bing_AdGroupNegativeKeywordsRequest>\n" +
                "</Bing_AdGroupNegativeKeywordsRequestCollection>";
        CampaignManager resource = new CampaignManager();
        System.out.println("Consuming SetNegativeKeywordsToCampaigns.....");
        String userName = testUtil.userName;
        String password = testUtil.password;
        String developerToken = testUtil.developerToken;
        long customerId = testUtil.customerId;
        long customerAccountId = testUtil.customerAccountId;
        String applicationId = testUtil.applicationId;
        long accountId = testUtil.accountId1;
        String result = resource.setNegativeKeywordsToCampaigns(6314423, campaignNegativeKeywordsCollectionXML);
        System.out.println("Result:\n" + result);
    }
}
